package com.iweb.controller;


import com.common.context.RequestMapping;
import com.common.model.DataGrid;
import com.common.model.Page;
import com.iweb.pojo.Ticket;
import com.iweb.service.TicketService;
import com.iweb.utils.JsonUtil;

import javax.servlet.http.HttpServletResponse;

/**
 * 视图渲染  返回值为 string
 *
 * */
public class TicketController {

    public void buying_tickets(){}

    /*@RequestMapping("Buying_Tickets")
    public int Buying_Tickets(Ticket ticket_sum , HttpServletRequest request){
        TicketService ticketService = new TicketService();
        Ticket result = TicketService.findTicketById(ticket_sum.getTicket_id());

    }*/

    @RequestMapping("findAdminList")
    // findAdminList
    public String findTicketsList(Page page, HttpServletResponse response) {
        TicketService ticketService = new TicketService();
        DataGrid<Ticket> dataGrid = ticketService.findTicketsList(page);
        JsonUtil.writeJsonStr(response,dataGrid);
        return null;
    }

    public String delete_ticket_sum(Ticket ticket){
        TicketService ticketService = new TicketService();
        ticketService.deleteById(ticket.getTicket_id());
        return "/tickets/Delete.jsp";
    }

}
